
var singleNumber = function(nums) {
    //11:40-55
    var hashMap = {}

    for(var i = 0; i < nums.length; i++){
        if(!hashMap[nums[i]]){
            hashMap[nums[i]] = 0
        }
        hashMap[nums[i]]++
    }

    for(var key in hashMap){
        if(hashMap[key] == 1){
            return key
        }
    }

}


function say() {
    alert("137. 只出现一次的数字 II");

    var nums = [2,2,3,2]
    var res = singleNumber(nums)
    console.log('结果',res)
}
say();

